export function arrayToBits(array: number[] = []): number {
  if (!array || !array.length) return 0
  return array.reduce((prev, curr) => (prev | curr), 0)
}

export function indexArrayToBits(array: number[] = []): number {
  if (!array || !array.length) return 0
  return array.reduce((prev, curr) => (prev | (1 << curr)), 0)
}

export function booleanToBits(...array: boolean[]): number {
  if (!array || !array.length) return 0
  return array.reduce((prev, curr, index) => (curr ? prev | (1 << index) : prev), 0)
}

